package com.photoeditor.demo.model.image.emoji;

import android.support.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Created by Lai on 2019/7/8 0008.
 */
public class StickerCategoryBean {

    @StickerBtnType
    private int mIconType;

    private String mPkgName;

    private String mUrl;

    private boolean mIsBuy;

    //资源文件
    public static final int ICON_TYPE_RESOURCE = 1;
    //网络图片
    public static final int ICON_TYPE_URL = 2;

    public StickerCategoryBean(int iconType, String pkgName, boolean isBuy) {
        mIconType = iconType;
        mPkgName = pkgName;
        mIsBuy = isBuy;
    }

    public StickerCategoryBean(int iconType, String pkgName, String url, boolean isBuy) {
        mIconType = iconType;
        mPkgName = pkgName;
        mUrl = url;
        mIsBuy = isBuy;
    }

    public static StickerCategoryBean newResourceBean(String pkgName, boolean isBuy) {
        return new StickerCategoryBean(ICON_TYPE_RESOURCE, pkgName, isBuy);
    }

    public static StickerCategoryBean newOnlineBean(String pkgName, String iconUrl, boolean isBuy) {
        return new StickerCategoryBean(ICON_TYPE_URL, pkgName, iconUrl, isBuy);
    }

    public boolean isBuy() {
        return mIsBuy;
    }

    @IntDef(value = {ICON_TYPE_RESOURCE, ICON_TYPE_URL})
    @Retention(RetentionPolicy.SOURCE)
    public @interface StickerBtnType {
    }


    public int getIconType() {
        return mIconType;
    }

    public void setIconType(int iconType) {
        mIconType = iconType;
    }

    public String getPkgName() {
        return mPkgName;
    }

    public void setPkgName(String pkgName) {
        mPkgName = pkgName;
    }

    public String getUrl() {
        return mUrl;
    }

    public void setUrl(String url) {
        mUrl = url;
    }

    public static int getIconTypeResource() {
        return ICON_TYPE_RESOURCE;
    }

    public static int getIconTypeUrl() {
        return ICON_TYPE_URL;
    }
}
